package com.huang.community.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;


import java.lang.annotation.Documented;
import java.util.Date;
@Data
@ToString
@Document(indexName = "discusspost", shards = 6, replicas = 3)
public class DiscussPost {
        @TableId(value = "id",type = IdType.AUTO)
        private Integer id;

        @Field(type = FieldType.Integer)
        private int userId;

        @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
        private String title;

        @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
        private String content;

        @Field(type = FieldType.Integer)
        private int type;

        @Field(type = FieldType.Integer)
        private int status;

        @Field(type = FieldType.Date,format = DateFormat.basic_date)
        private Date createTime;

        @Field(type = FieldType.Integer)
        private int commentCount;

        @Field(type = FieldType.Double)
        private double score;

}